/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javasetcollection;

import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author human
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        HashMap<String, Integer> map = new HashMap();

        map.put("Vasya Pupkin", 3000);
        map.put("Petya Pupkin", 4500);
        map.put("Misha Pupkin", 3700);

        Set<Map.Entry<String, Integer>> entrySet = map.entrySet();

        for (Map.Entry<String, Integer> entry : entrySet) {
            System.out.printf("%s, %s\n", entry.getKey(), entry.getValue());
        }

        System.out.println("- - - - - - - -");

        map.put("Vasya Pupkin", 7000);

        for (Map.Entry<String, Integer> entry : entrySet) {
            System.out.printf("%s, %s\n", entry.getKey(), entry.getValue());
        }

        System.out.println("- - - - - - - -");

        Set<String> keySet = map.keySet();

        for (String key : keySet) {
            Integer salary = map.get(key);

            System.out.printf("%s - %s\n", key, salary);
        }

        System.out.println("- - - - - - - -");

        Collection<Integer> values = map.values();
        for (Integer val : values) {
            System.out.println(val);
        }
        
        String temp = "Hello from World";
        String[] split = temp.split(" ");
        
        System.out.println(Arrays.toString(split));
    }
}
